import { mapGetters } from 'vuex'

// 导出一个 minin 对象
export default {
  computed: {
    ...mapGetters('m_cart', ['total'])
  },
  watch: {
    total(){
      this.setBadge()
    }
  },
  onShow(){
    this.setBadge()
  },
  methods: {
    setBadge(){
      uni.setTabBarBadge({
        index: 2,
        text: this.total+''
      })
    }
  }
}